﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Domain.Repository;
using MAF.Common;

namespace Domain
{
    public class Notepad
    {
        #region 单例

        /// <summary>
        /// 私有构造方法
        /// </summary>
        private Notepad() 
        {
            Memo = new Memo();
            Archive = new Archive();
        }

        /// <summary>
        /// 单例属性变量
        /// </summary>
        private static Notepad _Instance = null;

        /// <summary>
        /// 单例属性
        /// </summary>
        public static Notepad Instance
        {
            get
            {
                if (null == _Instance)
                    _Instance = new Notepad();
                return _Instance;
            }
        }

        #endregion

        #region 基础设施配置

        #endregion

        #region 主要属性

        /// <summary>
        /// 便签
        /// </summary>
        public Memo Memo { get; private set; }

        /// <summary>
        /// 便签存档
        /// </summary>
        public Archive Archive { get; private set; }

        #endregion
    }

    /// <summary>
    /// 配置类
    /// </summary>
    public class NotepadConfig
    {
        public static void SetStorage(IRepository<Note> notes)
        {
            Storage.MemNotes = notes;
        }
    }
}
